# coding:utf-8
from functools import wraps
from flask import abort
from flask_login import current_user


def admin_required(f):
    @wraps(f)
    def decorator(*args, **kwargs):
        if not current_user.isAdmin():
            abort(403)
        return f(*args, **kwargs)
    return decorator
